package com.rzx.mybackend.enums.games;

import java.util.Objects;

/**
 * GamesStatus
 *
 * @author renzhexian
 * @date 2025/9/15
 */

public enum GamesStatus {
    ON_SHELF("0", "已上架"),
    TO_BE_SHELVED("1", "待上架"),
    OFF_SHELF("2", "已下架");

    private final String code;
    private final String message;

    GamesStatus(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code) {
        for (GamesStatus value : GamesStatus.values()) {
            if (Objects.equals(value.code, code)) {
                return value.message;
            }
        }
        return null;
    }
}
